package genetic.q3.functions.math;

import genetic.Function;
import genetic.TreeNode;
import genetic.q3.functions.Computable;
import genetic.q3.functions.SymbolicRegressionFunction;

public class toRadians extends SymbolicRegressionFunction{

	public toRadians() {
		super(null);
	}
	
	public toRadians(TreeNode[] kids) {
		super(kids);
	}

	@Override
	public Function createInstance(TreeNode[] kids) {
		return new toRadians(kids);
	}

	@Override
	public TreeNode createRandomInstance(TreeNode[] kids) {
		return new toRadians(kids);
	}

	@Override
	public int getNumKids() {
		return 1;
	}

	@Override
	public String getName() {
		return "toRadians";
	}

	@Override
	public double compute(double xVal) {
		double val1 = ((Computable)kids[0]).compute(xVal);
		return Math.toRadians(val1);
	}
	
//	public static void main(String[] args) {
//		//(IEEEremainder (- (sinh (expm1 X)) (asin 5)) (expm1 (log1p 4)))
//		System.out.println(Math.expm1(Math.log1p(4)));
//		System.out.println(Math.sinh(Math.expm1(10)));
//	}
}
